#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
	int n,k;
	int i;
	double t1=0,t2=0,sum1=0,sum2=0;
	double r1,r2;
	cin>>n>>k;
	if (n<=10000 && k<=100)
	{
		for (i=1;i<=n;i++)
		{
			if (i%k==0)
			{
				t1 = t1 + 1;
				sum1 = sum1 + i;
			}
			else
			{
				t2 = t2 + 1;
				sum2 = sum2 +i;
			}
		}
		r1 = sum1 / t1;
		r2 = sum2 / t2;
		cout<<setprecision(1)<<setiosflags(ios::fixed)<<r1<<' '<<r2<<endl;
	}
	else cout<<"Error!"<<endl;
	return 0;
}
